var fc ="";
window.onload=function(){

	 function  D(a) {
        if (!a) return "";
        var a = a.toString(),
        c,
        b,
        f,
        e,
        g,
        h;
        f = a.length;
        b = 0;
        for (c = ""; b < f;) {
            e = a.charCodeAt(b++) & 255;
            if (b == f) {
                c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e >> 2);
                c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e & 3) << 4);
                c += "==";
                break
            }
            g = a.charCodeAt(b++);
            if (b == f) {
                c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e >> 2);
                c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e & 3) << 4 | (g & 240) >> 4);
                c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g & 15) << 2);
                c += "=";
                break
            }
            h = a.charCodeAt(b++);
            c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e >> 2);
            c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e & 3) << 4 | (g & 240) >> 4);
            c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g & 15) << 2 | (h & 192) >> 6);
            c += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h & 63)
        }
        return c
    };
    function E(a, c) {
        for (var b = [], f = 0, i, e = "", h = 0; 256 > h; h++) b[h] = h;
        for (h = 0; 256 > h; h++) f = (f + b[h] + a.charCodeAt(h % a.length)) % 256,
        i = b[h],
        b[h] = b[f],
        b[f] = i;
        for (var q = f = h = 0; q < c.length; q++) h = (h + 1) % 256,
        f = (f + b[h]) % 256,
        i = b[h],
        b[h] = b[f],
        b[f] = i,
        e += String.fromCharCode(c.charCodeAt(q) ^ b[(b[h] + b[f]) % 256]);
        return e
    }
	  function oa(a) {
        function c(a, c) {
            return a << c | a >>> 32 - c
        }
        function b(a) {
            var c = "",
            d, f;
            for (d = 7; 0 <= d; d--) f = a >>> 4 * d & 15,
            c += f.toString(16);
            return c
        }
        var f, i, e = Array(80),
        h = 1732584193,
        q = 4023233417,
        k = 2562383102,
        l = 271733878,
        m = 3285377520,
        o,
        n,
        t,
        p,
        r,
        a = function(a) {
            for (var a = a.replace(/\r\n/g, "\n"), c = "", b = 0; b < a.length; b++) {
                var d = a.charCodeAt(b);
                128 > d ? c += String.fromCharCode(d) : (127 < d && 2048 > d ? c += String.fromCharCode(d >> 6 | 192) : (c += String.fromCharCode(d >> 12 | 224), c += String.fromCharCode(d >> 6 & 63 | 128)), c += String.fromCharCode(d & 63 | 128))
            }
            return c
        } (a);
        o = a.length;
        var s = [];
        for (f = 0; f < o - 3; f += 4) i = a.charCodeAt(f) << 24 | a.charCodeAt(f + 1) << 16 | a.charCodeAt(f + 2) << 8 | a.charCodeAt(f + 3),
        s.push(i);
        switch (o % 4) {
        case 0:
            f = 2147483648;
            break;
        case 1:
            f = a.charCodeAt(o - 1) << 24 | 8388608;
            break;
        case 2:
            f = a.charCodeAt(o - 2) << 24 | a.charCodeAt(o - 1) << 16 | 32768;
            break;
        case 3:
            f = a.charCodeAt(o - 3) << 24 | a.charCodeAt(o - 2) << 16 | a.charCodeAt(o - 1) << 8 | 128
        }
        for (s.push(f); 14 != s.length % 16;) s.push(0);
        s.push(o >>> 29);
        s.push(o << 3 & 4294967295);
        for (a = 0; a < s.length; a += 16) {
            for (f = 0; 16 > f; f++) e[f] = s[a + f];
            for (f = 16; 79 >= f; f++) e[f] = c(e[f - 3] ^ e[f - 8] ^ e[f - 14] ^ e[f - 16], 1);
            i = h;
            o = q;
            n = k;
            t = l;
            p = m;
            for (f = 0; 19 >= f; f++) r = c(i, 5) + (o & n | ~o & t) + p + e[f] + 1518500249 & 4294967295,
            p = t,
            t = n,
            n = c(o, 30),
            o = i,
            i = r;
            for (f = 20; 39 >= f; f++) r = c(i, 5) + (o ^ n ^ t) + p + e[f] + 1859775393 & 4294967295,
            p = t,
            t = n,
            n = c(o, 30),
            o = i,
            i = r;
            for (f = 40; 59 >= f; f++) r = c(i, 5) + (o & n | o & t | n & t) + p + e[f] + 2400959708 & 4294967295,
            p = t,
            t = n,
            n = c(o, 30),
            o = i,
            i = r;
            for (f = 60; 79 >= f; f++) r = c(i, 5) + (o ^ n ^ t) + p + e[f] + 3395469782 & 4294967295,
            p = t,
            t = n,
            n = c(o, 30),
            o = i,
            i = r;
            h = h + i & 4294967295;
            q = q + o & 4294967295;
            k = k + n & 4294967295;
            l = l + t & 4294967295;
            m = m + p & 4294967295
        }
        r = b(h) + b(q) + b(k) + b(l) + b(m);
        return r.toLowerCase()
    }
   function na(a) {
        if (!a) return "";
        var a = a.toString(),
        c,
        b,
        f,
        i,
        e,
        h = [ - 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1];
        i = a.length;
        f = 0;
        for (e = ""; f < i;) {
            do c = h[a.charCodeAt(f++) & 255];
            while (f < i && -1 == c);
            if ( - 1 == c) break;
            do b = h[a.charCodeAt(f++) & 255];
            while (f < i && -1 == b);
            if ( - 1 == b) break;
            e += String.fromCharCode(c << 2 | (b & 48) >> 4);
            do {
                c = a.charCodeAt(f++) & 255;
                if (61 == c) return e;
                c = h[c]
            } while ( f < i && - 1 == c );
            if ( - 1 == c) break;
            e += String.fromCharCode((b & 15) << 4 | (c & 60) >> 2);
            do {
                b = a.charCodeAt(f++) & 255;
                if (61 == b) return e;
                b = h[b]
            } while ( f < i && - 1 == b );
            if ( - 1 == b) break;
            e += String.fromCharCode((c & 3) << 6 | b)
        }
        return e
    }
	    function F(a, c) {
        for (var b = [], f = 0; f < a.length; f++) {
            for (var i = 0,
            i = "a" <= a[f] && "z" >= a[f] ? a[f].charCodeAt(0) - 97 : a[f] - 0 + 26, e = 0; 36 > e; e++) if (c[e] == i) {
                i = e;
                break
            }
            b[f] = 25 < i ? i - 26 : String.fromCharCode(i + 97)
        }
        return b.join("")
    }

	console.log("A:");
	  e = {
        playerType: "",
        uniplayerUrl: "http://passport-log.youku.com/logsys/logstorage/append?project=uniplayer&log=",
        MPIECEURL: "http://passport-log.youku.com/logsys/logstorage/append?project=mpiece&log=",
        userCache: {
            a1: "4",
            a2: "1"
        }};
//getFileAdress("mp4", "mp4area");
    getFileAdress("flv", "flvarea");
//   getFileAdress("hd2", "hd2area");
  function getFileAdress(type, area) {    
   c = E(F("b4et" + "o0b" + e.userCache.a1, [19, 1, 4, 7, 30, 14, 28, 8, 24, 17, 6, 35, 34, 16, 9, 10, 13, 22, 32, 29, 31, 21, 18, 3, 2, 23, 25, 27, 11, 20, 5, 15, 12, 0, 33, 26]).toString(), na(ep));
	//alert ( na(ep));
	//alert (c);

    e.userCache.sid = c.split("_")[0];
	//alert (e.userCache.sid);
    e.userCache.token = c.split("_")[1];
	//alert ('thisis'+e.userCache.token);

for (var i in playlist_f[type]) 
{ 
f=playlist_f[type][i];
         key=playlist_k[type][i]  
console.log(area);
var q=type;
    if(q=="h2d")
        q="flv";
    h=1;
l=140;
d="";
		if(i<10)
				k="0"+i;
		if(i==10)
				k="0A";
		if(i==11)
				k="0B";
		if(i==12)
				k="0C";
		if(i==13)
				k="0D";
		if(i==14)
				k="0E";
		if(i==15)
				k="0F";
    if(i>15)
        k="1"+(i-16);
	 //alert('one'+f);
   c = "/player/getFlvPath/sid/" + e.userCache.sid + "_" + k + "/st/" + q + "/fileid/" + f + "?K=" + key;
 f = encodeURIComponent(D(E(F("boa4poz1", [19, 1, 4, 7, 30, 14, 28, 8, 24, 17, 6, 35, 34, 16, 9, 10, 13, 22, 32, 29, 31, 21, 18, 3, 2, 23, 25, 27, 11, 20, 5, 15, 12, 0, 33, 26]).toString(), e.userCache.sid + "_" + f + "_" + e.userCache.token)));
 //alert(f);
            c = c + "&ctype=12&ev=1" + ("&token=" + e.userCache.token)+("&ep=" + f);
            c += "&oip=" + oip;


//alert('http://k.youku.com'+c);
fc = fc + 'http://k.youku.com'+c+'|';


}
  }
fc=fc.substring(0,fc.length - 1);
	var flashvars={
		f:fc,
		c:0,
		b:1,
		p:1,
		};
	var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always'};
	CKobject.embedSWF('/play/ckplayer/ckplayer.swf','a1','ckplayer_a1','640','500',flashvars,params);
}